package OrderService

import (
	"context"
	toolsDb "gdshop-back-end-go/common/db"
)

func GetOrderNumByMemberIdAndStatus(ctx context.Context, memberId int, status []int) int {
	count, countErr := toolsDb.GetUnSafaTableAddDeleteWhere(
		ctx,
		"order").Where(
		"delete_at<1 AND member_id=? AND status IN (?)",
		memberId,
		status,
	).Fields(
		"1").Count()
	if countErr != nil {
		return 0
	}

	return count
}
